package com.sskj.community.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.community.ui.activity.ShareHotActivity;
import com.sskj.lib.bean.ShareBean;
import com.sskj.lib.bean.TextDetailsBean;
import com.sskj.lib.http.JsonCallBack;


/**
 * @author Hey
 * Create at  2019/07/17
 */
public class ShareHotPresenter extends BasePresenter<ShareHotActivity> {


    public void getTextDetails(String msg_id) {
        httpService.getTextDetails(msg_id)
                .tag(this)
                .execute(new JsonCallBack<HttpData<TextDetailsBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<TextDetailsBean>> response) {
                        TextDetailsBean data = response.body().getData();
                        mView.getTextDetails(data);
                    }
                });
    }


    public void getShareInfo() {
        httpService.getShareInfo()
                .tag(this)
                .execute(new JsonCallBack<HttpData<ShareBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<ShareBean>> response) {
                        mView.getShareInfoOK(response.body().getData());
                    }
                });
    }

}
